package cn.minhx.mw.dtp.sdk.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author minhx
 */
@Data
@ConfigurationProperties(prefix = "dynamic.thread.pool.registry.redis", ignoreInvalidFields = true)
public class DynamicThreadPoolProperties {

    /**
     * 是否启用
     */
    private boolean enable;
    /**
     * redis host
     */
    private String host;
    /**
     * redis port
     */
    private int port;
    /**
     * redis logic database
     */
    private int database;
    /**
     * redis password
     */
    private String password;
    /**
     * 连接池的大小
     */
    private int poolSize = 20;
    /**
     * 连接池的最小空闲连接数
     */
    private int minIdleSize = 5;
    /**
     * 连接的最大空闲时间 ms
     */
    private int idleTimeout = 10000;
    /**
     * 连接超时时间 ms
     */
    private int connectTimeout = 10000;
    /**
     * 连接重试次数
     */
    private int retryAttempts = 3;
    /**
     * 连接重试的间隔时间 ms
     */
    private int retryInterval = 1000;
    /**
     * 定期检查连接是否可用的时间间隔 ms
     */
    private int pingInterval = 0;
    /**
     * 是否保持长连接
     */
    private boolean keepAlive = true;
}
